{% extends 'public/base.html' %}
{% block 'con' %}
        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <div class="page-header-heading">
                            <span class="am-icon-user-plus page-header-heading-icon"></span> 用户edit
                        </div>
                    </div>
                </div>
            </div>

            <div class="widget am-cf">
                           
                <div class="widget-body am-fr">

                    <form action="{% url 'userupdate' %}"  method="post"  enctype="multipart/form-data" class="am-form tpl-form-line-form" >
                        
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">用户名 </label>
                            <div class="am-u-sm-9">
                               <input type="text" class="tpl-form-input" name="username" value ="{{ info.username }}" > 
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">密码 </label>
                            <div class="am-u-sm-9">
                                <input type="password" class="tpl-form-input" name="password" value ="" >
                            </div>
                        </div>
                    
                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">年龄 </label>
                            <div class="am-u-sm-9">
                                <input type="number" name="age"  value ="{{ info.age }}">
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-email" class="am-u-sm-3 am-form-label">邮箱 </label>
                            <div class="am-u-sm-9">
                                <input type="email" class="tpl-form-input" name="email" value ="{{ info.email }}" >
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label for="user-phone" class="am-u-sm-3 am-form-label">状态 </label>
                            <div class="am-u-sm-9">
                                <select data-am-selected="{searchBox: 1}" style="display: none;" name="status">
                                    <option value="a" {% if  info.status == 'a' %} selected {% endif %}>普通会员</option>
                                    <option value="b" {% if  info.status == 'b' %} selected {% endif %}>管理者</option>
                                    <option value="c" {% if  info.status == 'c' %} selected {% endif %}>已禁用</option>
                                </select>
                    
                            </div>
                        </div>

                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">手机 </label>
                            <div class="am-u-sm-9">
                                <input type="text" name="phone" value ="{{ info.phone }}" >
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">地址 </label>
                            <div class="am-u-sm-9">
                                <input type="text" class="tpl-form-input" name="address" value ="{{ info.address }}" >
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">性别 </label>
                            <div class="am-form-group">
                               <label class="am-radio-inline"><input type="radio" name="sex" value="0"  {% if  info.sex == '0' %} checked {% endif %}> 男</label>
                               
                               <label class="am-radio-inline"><input type="radio" name="sex" value="1" {% if  info.sex == '1' %} checked {% endif %}> 女</label>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <label for="user-weibo" class="am-u-sm-3 am-form-label">头像 </label>
                            <div class="am-u-sm-9">
                                <div class="am-form-group am-form-file">
                                    <div class="tpl-form-file-img">
                                        <img width="200" src="{{ info.pic }}" alt="zhanwei">
                                    </div>
                                    <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                        <i class="am-icon-cloud-upload"></i> 上传图片
                                    </button>
                                    <input id="doc-form-file" name="pic" type="file" multiple="">
                                </div>

                            </div>
                        </div>


			{% csrf_token %}
                            <input type="hidden" name="uid" value="{{ info.id }}">


                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button  class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
{% endblock %}
